package com.hc.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author hecai
 * 用户表
 */
@ApiModel(value = "用户表")
@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_user")
public class User implements Serializable {

    private static final long serialVersionUID = -3827093860065173075L;
    /**
     * 用户编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "用户编号")
    private Long id;

    /**
     * 用户名
     */
    @TableField(value = "username")
    @ApiModelProperty(value = "用户名")
    private String username;
    /**
     * 密码
     */
    @TableField(value = "`password`")
    @ApiModelProperty(value = "密码")
    private String password;
    /**
     * 昵称
     */
    @TableField(value = "nickname")
    @ApiModelProperty(value = "昵称")
    private String nickname;
    /**
     * 邮箱
     */
    @TableField(value = "email")
    @ApiModelProperty(value = "邮箱")
    private String email;
    /**
     * 电话
     */
    @TableField(value = "tel")
    @ApiModelProperty(value = "电话")
    private String tel;
    /**
     * 性别：1女 2男 3未知
     */
    @TableField(value = "gender")
    @ApiModelProperty(value = "性别：1女 2男 3未知")
    private Integer gender;
    /**
     * 生日
     */
    @TableField(value = "birth")
    @ApiModelProperty(value = "生日")
    private LocalDate birth;
    /**
     * 头像
     */
    @TableField(value = "avatar")
    @ApiModelProperty(value = "头像")
    private String avatar;
    /**
     * 外键：角色编号
     */
    @TableField(value = "role_id")
    @ApiModelProperty(value = "外键：角色编号")
    private Integer roleId;

    /**
     * 优先级
     */
    @TableField(value = "priority")
    @ApiModelProperty(value = "活跃度")
    private Integer priority;

    /**
     * 用户注册的收件地址个数
     */
    @TableField(value = "receive_addrs")
    @ApiModelProperty(value = "用户注册的收件地址个数")
    private Integer receiveAddrs;

    /**
     * 状态：1未激活，2激活，功能受限
     */
    @TableField(value = "`status`")
    @ApiModelProperty(value = "状态：1未激活，2激活，功能受限")
    private Integer status;
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;
    /**
     * 更新日期
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "更新日期")
    private LocalDateTime updateTime;
}